<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /*
        1. 对象引用赋值
        2. 属性的读取是基于原型链查找
        3. 对象是构造函数创建的，对象原型继承构造函数原型
      */
      function Rabbit() {
        // this={}
        // this.__proto__ = Rabbit.prototype;
        // return this;
      }

      Rabbit.prototype.eats = true;

      const r1 = new Rabbit(); // 执行 this.__proto__ = Rabbit.prototype;

      // Rabbit.prototype = {};
      // Rabbit.prototype.eats = false;
      // delete r1.eats;
      delete Rabbit.prototype.eats;
      console.log(r1.eats); // undefined
    </script>
  </body>
</html>
